]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
message-tray: Move check for _actorDestroyed into _setCount()
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Jul 2011 20:23:03 +0000 (22:23 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Jul 2011 20:27:15 +0000 (22:27 +0200)
As _updateCount has been designed to be overwritable by subclasses,
move the check for _actorDestroyed into _setCount(), to fix the
problem described in commit 5f6ac33d5 in derived types as well.

js/ui/messageTray.js

index bf72a0f585861afe7bc82ee0c5961462ce4693cb..41475c1061a34817bf294ef4a8fb9a017044f2d1 100644 (file)
@@ -949,14 +949,14 @@ Source.prototype = {
         if (isNaN(parseInt(count)))
             throw new Error("Invalid notification count: " + count);
 
+        if (this._actorDestroyed)
+            return;
+
         this._counterBin.visible = visible;
         this._counterLabel.set_text(count.toString());
     },
 
     _updateCount: function() {
-        if (this._actorDestroyed)
-            return;
-
         let count = this.notifications.length;
         this._setCount(count, count > 1);
     },